import React from 'react';
import InvertColorsOutlined from '@material-ui/icons/InvertColorsOutlined';
import { NavView, get_mod, loc, NavListSub } from 'sui';
import { TaskView } from './task/view';
import { TraceView } from './trace/view';
import { UserView } from './user';
import { OrderView } from './order';
import { PickView } from './pick';

const model = (cfg) => {
    const fix = [
        {uid: "oil.task", view: TaskView,  value: loc("l_113")},
        {uid: "oil.pick", view: PickView, value: loc("l_723")},
        {uid: "oil.order", view: OrderView, value: loc("l_781")},
        {uid: "oil.trace", view: TraceView,  value: loc("l_112")},
        {uid: "oil.oiltp", view: UserView,  value: loc("l_109")},
    ];

    return get_mod(cfg, fix, "oil");
};

const Oil = ({ mod, sideopen, cfg }) => <NavView cfg={cfg} model={model(cfg)} mod={mod} sideopen={sideopen} name="oil"/>;

const NavOil = (props) => <NavListSub icon={<InvertColorsOutlined/>} sub={model(props.cfg)} {...props} scut={15}/>;

export {NavOil, Oil};
